package com.hmall.clients;

import com.hmall.common.dto.PageDTO;
import com.hmall.pojo.Item;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "itemservice")
public interface ItemClient {


     @GetMapping("/item/all")
     List<Item> findAll();


     @GetMapping("/item/{id}")
      Item getById(@PathVariable Long id);


    @GetMapping("/item/list")
    PageDTO<Item> list(@RequestParam(name = "page") Integer page,@RequestParam(name = "size") Integer size);

    @GetMapping("/item/count")
     Integer count();

    @PutMapping("/item")
     void update(@RequestBody Item item);

    @GetMapping("/item")
     void update2(@RequestBody Item item);
}
